
import redis
conn=redis.Redis()


# 1 set(name, value, ex=None, px=None, nx=False, xx=False)
# conn.set('name1','zty',ex=8)
# conn.set('name1','zy',nx=True)
# conn.set('name1','zy',xx=True)

# 2 setnx(name, value)
# conn.setnx('name2','zty')

#3 setex(name, time, value)

# conn.setex('name',8,'zty')
#4 psetex(name, time_ms, value) 以毫秒过期时间
# conn.psetex('name1',3000,'ss')






































conn.close()